<?php
namespace Home\Controller;

use Think\Controller;

class IndexController extends BaseController
{

    public function index()
    {

        //公司介绍
        $company = M('single_page')->where(array('cate_id' => 44))->find();

        if($company && $company['content'])
        {
            $company['content'] = trim(strip_tags(htmlspecialchars_decode($company['content'])));
        }
        //网站公告
        $where = array('cate_id' => 43, 'status' => 1);
        $notice = D('article')->getList($where, 3);
        //新闻动态
        $where = array('cate_id' => 42, 'status' => 1);  // cate_id =42
        $news = D('article')->getList($where, 3);
        $current = current($news);
        $this->assign('notice', $notice);
        $this->assign('news', $news);
        $this->assign('company', $company);
        $this->assign('current', $current);
        $this->display();
    }
}